<?php
	include_once '../../conn/all.php';
	$class=$_GET['class'];
	$res=sql("s", "article", "*","where class=".$class);
	$level=arrayLevel($res);
	if ($level==1) {
		$id=$res["id"];
		$keyword=$res["keyword"];
		$decription=$res["description"];
		$content=$res["content"];
		$title=$res["title"];
		$imgurl=$res['imgurl'];
	}else{
		$id="";
		$keyword="";
		$decription="";
		$content="";
		$title="";
		$imgurl="";
	}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="../templates/met/images/css/reset.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="../templates/met/images/css/metinfo.css" />

<style type="text/css">
body{
	font-size: ; 
	font-family:;
	text-align:center;
}
</style>

<link rel="stylesheet" href="../../editor/themes/default/default.css" />
	<link rel="stylesheet" href="../../editor/plugins/code/prettify.css" />
	<script charset="utf-8" src="../../editor/kindeditor.js"></script>
	<script charset="utf-8" src="../../editor/lang/zh_CN.js"></script>
	<script charset="utf-8" src="../../editor/plugins/code/prettify.js"></script>
<script>

		KindEditor.ready(function(K) {
			var editor1 = K.create('textarea[name="content"]', {
				cssPath : '../../editor/plugins/code/prettify.css',
				uploadJson : '../../editor/php/upload_json.php',
				fileManagerJson : '.../../editor/php/file_manager_json.php',
				allowFileManager : true,
				afterCreate : function() {
					var self = this;
					K.ctrl(document, 13, function() {
						self.sync();
						K('form[name=myform]')[0].submit();
					});
					K.ctrl(self.edit.doc, 13, function() {
						self.sync();
						K('form[name=myform]')[0].submit();
					});
				}
			});
			prettyPrint();
		});
	</script>
<title>添加内容</title>


</head>
<body>

<form  method="post"  name="myform" action="../control.php?oper=article&class=<?=$class;?>" target="_self">
	
<table cellpadding="2" cellspacing="1" class="table">
          <tr> 
            <td colspan="3" class="title">添加内容</td>
          </tr>		  

		  <tr> 
            <td class="text"><font class="must">*</font>标题</td>
            <td colspan="2" class="input"> <input name="title" type="text" class="text nonull" value="<?=$title;?>"></td>
          </tr>
 <tr> 
            <td class="text">图片地址<br><font color='red' >自动生成缩略图</span></td>
            <td colspan="2" class="input upload"> 
				<input name="imgurl" id="imgurl" type="text" class="text" value="<?=$imgurl;?>"> 
				<div id='up_img'><iframe ID="UploadFiles" src="../include/upload_photo.php?class=article&imgurl=<?=$imgurl;?>&id=<?=$id;?>" frameborder=0 scrolling=no></iframe></div>
				
           
				</td>
          </tr> 
		  <tr> 
            <td class="text">关键词</td>
            <td colspan="2" class="input"><input name="keyword" type="text" class="text" value="<?=$keyword;?>">用于搜索引擎优化,多个关键词请用","隔开</td>
          </tr>
		  <tr> 
            <td class="text">简短描述<br>用于搜索引擎优化
			</td>
            <td class="input" colspan="2"><textarea name="description" cols="60" class="textarea gen" rows="5" ><?=$decription;?></textarea></td>
			</tr> 
			 <tr> 
            <td class="text">
			
        详细内容
		
			</td>
            <td class="input" colspan="2">
			<div class="edir-hide">
			<div class="left-hiden"></div>
<script type="text/javascript" src="../ckeditor/ckeditor.js"></script>
			<textarea id="content" name="content"><?=$content;?></textarea>

</div>
</td></tr>

		  <tr> 
            <td class="text"></td>
	      <td class="submit"><input type="submit" name="Submit" value="保存" class="submit" onclick="return Smit($(this),'myform')" /><input type="reset" name="Submit" value="重置" class="reset" /> </td>
          </tr>
		<tr>
		  <td class="footer" colspan="2"> </td>
	  </tr>
</table>        
</form>
</body>
</html>
